/**
 * @see https://umijs.org/zh-CN/plugins/plugin-access
 * */

export default function access(initialState: { currentUser?: API.CurrentUser } | undefined) {
  const { currentUser } = initialState ?? {};
  console.group('权限文件的输出');
  console.log(currentUser);
  console.groupEnd();

  // 在这里配置权限信息
  return {
    canAdmin: currentUser && currentUser.role.name === 'ck',
  };
}
